package com.lenovo.gpsautotest;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.lenovo.gpsautotest.AMap.AMapActivity;
import com.lenovo.gpsautotest.MapView.MapViewActivity;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class WelcomeActivity extends AppCompatActivity {

    @OnClick(R.id.to_AMap)
    void toAMap() {
        Intent intent = new Intent(WelcomeActivity.this, AMapActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
    }

    @OnClick(R.id.to_location_manager)
    void toLocationManager() {
        Intent intent = new Intent(WelcomeActivity.this, MainActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
    }

    @OnClick(R.id.to_offline_map)
    void toOfflineMap() {
        //在Activity页面调用startActvity启动离线地图组件
        startActivity(new Intent(this.getApplicationContext(),
                com.amap.api.maps.offlinemap.OfflineMapActivity.class));
    }

    @OnClick(R.id.to_map_view)
    void toMapView(){
        Intent intent = new Intent(WelcomeActivity.this, MapViewActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        ButterKnife.bind(this);
    }
}
